package com.vhly.ddxdecompiler.dexreader.file.dalv.code;

import com.vhly.ddxdecompiler.dexreader.file.dalv.code.reader.InsnReader;
import com.vhly.ddxdecompiler.dexreader.io.DexInputStream;

import java.io.IOException;

/**
 * Created by IntelliJ IDEA.
 * User: vhly
 * Date: 2009-10-21
 * Time: 13:54:24
 *
 * @author vhly[FR]
 */
public class FixedSizeInsn extends DalvInsn {

    public FixedSizeInsn(int first) {
        opcode = first & 0x0ff;
        dexOpcode = Dops.get(opcode);
        System.out.println(""+dexOpcode);
        InsnReader reader = dexOpcode.getInsnReader();
        if (reader.hasRegister()) {
            int reg = (first >> 8) & 0x0ff;
            reader.prepair(this, reg);
        }
    }

    public int read(DexInputStream din) throws IOException {
        return dexOpcode.getInsnReader().read(this, din);
    }

    /**
     * 转换为Java ByteCode
     *
     * @return byte[]
     */
    public byte[] reverseJava() {
        return new byte[0];
    }
}
